<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/style.css" />
		<script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>
		<script type="text/javascript" src="js/assist.js" ></script>
	</head>
	<body>
		<h3>内容过滤选择器.</h3> <button id="reset">手动重置页面元素</button> 
		<input type="checkbox" id="isreset" checked="checked" />
		<label for="isreset">点击下列按钮时先自动 重置页面</label><br /><br /> 
		<input type="button" value="选取含有文本“di”的div元素." id="btn1" /> 
		<input type="button" value="选取不包含子元素(或者文本元素)的div空元素." id="btn2" /> 
		<input type="button" value="选取含有class为mini元素 的div父元素." id="btn3" /> 
		<input type="button" value="选取含有子元素(或者文本元素)的div元素." id="btn4" /> 
		<input type="button" value="选取所有可见的div元素." id="btn_visible" /> <br/> 
		<input type="button" value="选取所有不可见的元素.包括&lt;input type='hidden'/&gt;和&lt;div style='display:none;'&gt;." id="btn_hidden" /> <br /><br />
		<!‐‐ 测试的元素 ‐‐>
		<div class="one" id="one"> id为one,class为one的div
			<div class="mini">class为mini</div>
		</div>
		<div class="one" id="two" title="test"> id为two,class为one,title为test的div.
			<div class="mini" title="other">class为mini,title为other</div>
			<div class="mini" title="test">class为mini,title为test</div>
		</div>
		<div class="one">
			<div class="mini">class为mini</div>
			<div class="mini">class为mini</div>
			<div class="mini">class为mini</div>
			<div class="mini"></div>
		</div>
		<div class="one">
			<div class="mini">class为mini</div>
			<div class="mini">class为mini</div>
			<div class="mini">class为mini</div>
			<div class="mini" title="tesst">class为mini,title为tesst</div>
		</div>
		<div style="display:none;" class="none">style的display为"none"的div</div>
		<div class="hide">class为"hide"的div</div>
		<div>
			6、表单选择器 包含input的type为"hidden"的div<input type="hidden" size="8" value="2" /> </div> 
			<span id="mover">正在执行动画的span元素.</span>
	</body>
	<script type="text/javascript">
		$(function(){
			$("#btn1").click(function(){
				$("div:contains('di')").css("background-color","greenyellow")
			});
			$("#btn2").click(function(){
				$("div:empty").css("background-color","blueviolet")
			});
			$("#btn3").click(function(){
				$("div:has('.mini')").css("background-color","blue")
			});
			$("#btn4").click(function(){
				$("div:parent").css("background-color","darkcyan")
			});
			$("#btn_visible").click(function(){
				$("div:visible").css("background-color","yellow")
			});
			$("#btn_hidden").click(function(){
				$("div:hidden").css("background-color","red")
				console.log("所有不可见的元素个数为"+$("div:hidden").length+"个")
			});
		})
	</script>
</html>
